//===============================================================================
// Microsoft Architecture Strategy Team
// LitwareHR - SaaS Sample Application
//===============================================================================
// Copyright  Microsoft Corporation.  All rights reserved.
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
// The example companies, organizations, products, domain names,
// e-mail addresses, logos, people, places, and events depicted
// herein are fictitious.  No association with any real company,
// organization, product, domain name, email address, logo, person,
// places, or events is intended or should be inferred.
//===============================================================================



using System;
using System.Collections.Generic;
using System.Text;
using System.IdentityModel.Selectors;
using System.ServiceModel.Description;
using System.Security.Cryptography.X509Certificates;

namespace Shp.Security.BrokeredReceiver
{
    /// <summary>
    /// Custom credentials. This implementation returns a custom security token manager
    /// </summary>
    public class StsServiceCredentials : ServiceCredentials
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="T:StsServiceCredentials"/> class.
        /// </summary>
        public StsServiceCredentials()
            : base()
        {
        }

        /// <summary>
        /// Copies the essential members of the current instance.
        /// </summary>
        /// <returns>
        /// A <see cref="T:System.ServiceModel.Description.ServiceCredentials"></see> instance.
        /// </returns>
        protected override ServiceCredentials CloneCore()
        {
            return this;
        }

        /// <summary>
        /// Creates a token manager for this service.
        /// </summary>
        /// <returns>
        /// A <see cref="T:System.ServiceModel.Security.ServiceCredentialsSecurityTokenManager"></see> instance.
        /// </returns>
        public override SecurityTokenManager CreateSecurityTokenManager()
        {
            return new StsSecurityTokenManager(this);
        }
    }
}
